<%@ page language="java" contentType="text/html;charset=utf-8"
	pageEncoding="utf-8"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>CDSF座舱显控系统管理环境</title>
<!-- meta info -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="add_interface">
<meta name="author" content="Sun Ke">

<!-- Le styles -->
<link href="<c:url value='/css/bootstrap.min.css'/>" rel="stylesheet">
<style type="text/css">
body {
	padding-top: 40px;
	padding-bottom: 40px;
	background-color: #f5f5f5;
}

.form-signin {
	max-width: 420px;
	padding: 19px 29px 29px;
	margin: 0 auto 20px;
	background-color: #fff;
	border: 1px solid #e5e5e5;
	-webkit-border-radius: 5px;
	-moz-border-radius: 5px;
	border-radius: 5px;
	-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
	-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
	box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

.form-signin .form-signin-heading,.form-signin .checkbox {
	margin-bottom: 10px;
}

.form-signin input[type="text"],.form-signin input[type="password"] {
	font-size: 16px;
	height: auto;
	margin-bottom: 15px;
	padding: 7px 9px;
}
</style>
<link href="<c:url value='/css/bootstrap-responsive.min.css'/>"
	rel="stylesheet">
<link href="<c:url value='/css/bootstrap-responsive.css'/>"
	rel="stylesheet">
<link href="<c:url value='/css/docs.css'/>" rel="stylesheet">
<link href="<c:url value='/css/prettify.css'/>" rel="stylesheet">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
      <script src="//cdnjs.bootcss.com/ajax/libs/html5shiv/3.6.2/html5shiv.js"></script>
    <![endif]-->

<!-- Fav and touch icons -->
<link rel="shortcut icon" href="<c:url value='/img/icon.png'/>">
<script src="<c:url value='/js/jquery.min.js'/>"></script>
<script type="text/javascript">
	function valid() {
		$("#div_username").removeClass("control-group error");
		$("#div_username").addClass("control-group");
		$("#div_password").removeClass("control-group error");
		$("#div_password").addClass("control-group");
		$("#div_repassword").removeClass("control-group error");
		$("#div_repassword").addClass("control-group");
		document.getElementById("help_username").innerHTML = "";
		document.getElementById("help_password").innerHTML = "";
		document.getElementById("help_repassword").innerHTML = "";
		var username = $("#username").val().trim();
		var password = $("#password").val().trim();
		var repassword = $("#repassword").val().trim();
		//alert("username"+username+"password"+password+"repassword"+repassword);
		if (username == "") {
			$("#div_username").removeClass("control-group");
			$("#div_username").addClass("control-group error");
			document.getElementById("help_username").innerHTML = "用户名不能为空";
			return false;
		}
		if (password == "") {
			$("#div_password").removeClass("control-group");
			$("#div_password").addClass("control-group error");
			document.getElementById("help_password").innerHTML = "密码不能为空";
			return false;
		}
		if (repassword == "") {
			$("#div_repassword").removeClass("control-group");
			$("#div_repassword").addClass("control-group error");
			document.getElementById("help_repassword").innerHTML = "确认密码不能为空";
			return false;
		}
		if (password != repassword) {
			$("#div_repassword").removeClass("control-group");
			$("#div_repassword").addClass("control-group error");
			document.getElementById("help_repassword").innerHTML = "确认密码与密码不一致";
			return false;
		}
		return true;
	}
</script>
</head>

<body>
	<div align=center>
		<img src="<c:url value='/img/csdf.jpg'/>">
	</div>
	<hr>
	<div class="container">
		<form class="form-signin"
			action="<%=request.getContextPath()%>/register/submit" method="POST"
			onsubmit="return valid()">
			<legend>注册新用户</legend>
			<fieldset>
				<div class="control-group" id="div_username">
					<!-- <label class="control-label">用户名&nbsp;</label> -->
					<div class="controls">
						<input type="text" placeholder="用户名" name="username" id="username" />
						<span class="help-inline" id="help_username">${errormsg}</span>
					</div>
				</div>
				<div class="control-group" id="div_password">
					<!-- <label class="control-label">密码&nbsp;</label> -->
					<div class="controls">
						<input type="password" placeholder="密码" name="password"
							id="password" /> <span class="help-inline" id="help_password"></span>
					</div>
				</div>
				<div class="control-group" id="div_repassword">
					<!-- <label class="control-label">确认密码&nbsp;</label> -->
					<div class="controls">
						<input type="password" placeholder="确认密码" name="repassword"
							id="repassword" /> <span class="help-inline"
							id="help_repassword"></span>
					</div>
				</div>
				<div class="control-group">
					<!-- <label class="control-label">真实姓名&nbsp;</label> -->
					<div class="controls">
						<input type="text" placeholder="真实姓名" name="realname" />
					</div>
				</div>
				<div class="control-group">
					<!-- <label class="control-label">工号&nbsp;</label> -->
					<div class="controls">
						<input type="text" placeholder="工号" name="staffnum" />
					</div>
				</div>
				<div class="control-group">
					<!-- <label class="control-label">email&nbsp;</label> -->
					<div class="controls">
						<input type="text" placeholder="email" name="email" />
					</div>
				</div>
				<div class="control-group">
					<input class="btn" type="submit" value="提交"/>
					<br>
					<p style="margin-top: 20px">
						已有帐户？<a href="<%=request.getContextPath()%>/login">登录</a>
					</p>
				</div>
			</fieldset>
		</form>
	</div>
	<!-- /container -->

	<hr>

	<footer>
		<center>
			<p>CDSF座舱显控系统管理环境 2014</p>
		</center>
	</footer>

	</div>

</body>
</html>
